The present invention is directed to a method and apparatus for distributing information about events occurring in a computer, and in particular an event manager which manages the distribution of those events to the appropriate entities within the computer.
For purposes of this description, an event is any occurrence in a computer of which software programs running on that computer or on a connected computer might need to be informed. Events may include occurrences such as, for example, a keystroke, a mouse click, disk insertion and ejection, network connection and disconnection, the computer entering a "sleep mode" shutdown, a window uncovered (i.e., the contents of the window need to be redisplayed), a new file created, a directory renamed, the contents of file changed, and the tree space on a volume changed, etc.
Interrupts and error conditions may also be counted as atypical examples of events. In particular, interrupts need to be handled by a program so an event manager is an inappropriate solution. However, the code which does handle the interrupt might generate an event based on the interpretation of the interrupt. For example, the computer might generate an interrupt when the user inserts a floppy disk. The interrupt itself is unlikely to be propagated by the event manager, but it would be reasonable for the interrupt handler to produce a "disk inserted" event. Error conditions are similar. Most of the time it is necessary for one of the computer programs on the system to handle the error, therefore more direct point to point mechanisms are appropriate. However, there are kinds of errors which are more advisory in nature which would be appropriate to be sent via events. For example, some portable computers take various actions to reduce power consumption when the battery gets low. It would be appropriate to produce an event called "battery low" to inform all software programs of the condition, and have all of the software which can reduce power consumption consume these events.
Currently, known operating systems all have some type of mechanism for managing the events that occur within the computer. However, these mechanisms use a point-to-point method of managing the events. That is, the entities producing or detecting events distribute the events to the entities using the events. To accomplish this, all of the entities producing or detecting events must know which entities they must notify when a particular event is generated within the computer. This configuration is very cumbersome and inefficient. Further, it is resource intensive since all entities producing or detecting events must have information on all the events they produce or detect and also on all the entities interested in those events. This information is both extensive and constantly changing, causing modifications to be difficult.
Further, point-to-point mechanisms lack flexibility. Under point-to-point schemes, if there is a new consumer of an event, a new version of the producer must be released which knows about the new consumer. Or if a new kind of event becomes necessary, a new version of the event manager must be released which knows how to distribute the new kind of event.
It is desirable to provide an apparatus for efficiently dealing with all kinds of events in an operating system and for distributing information regarding specific kinds of events to programs which require such information. To this end, it is also desirable to improve the system performance and reduce the resources required to distribute such information. To meet these goals, it is desirable to provide an apparatus for managing events in which communication between the event producers and consumers is facilitated without requiring each event producer to be aware of all of the event consumers.